{% extends 'table_base.html' %}

{% block htmltitle %}学生活动中心场所申请{% endblock %}

{% block htmlhead %}
    {% load html_tools %}

    {{ 'student_activity_center/table.css' | as_css }}

    {{ 'artDialog/v4/artDialog.js'    | as_js  }}
    {{ 'artDialog/v4/skins/opera.css' | as_css }}
    {{ 'artDialog/popupBox.css'       | as_css }}

    {{ 'popupBox.js'  | as_js  }}
{% endblock %}

{% block top_title %}<h1 style="font-size:58px">学生活动中心场所申请</h1>{% endblock %}
{% block title %}学生活动中心场所一周安排表(图形版){% endblock %}

{% block main_content %}
    <table class="app_table">
    	<tr class="date">
    		<td class="blue place" rowspan="2">活动场地</td>
            {% for date in table.date %}
    		    <td colspan="3">{{ date | date:"m月d日" }}<br />{{ date | date:"l" }}</td>
            {% endfor %}
        {% load range %}
    	<tr>
            {% for i in 7|get_range %}
    		<td>上午<br />08:00-<br/>12:00</td>
    		<td>下午<br />14:00-<br/>17:00</td>
    		<td>晚上<br />19:00-<br/>122:30</td>
            {% endfor %}
    	</tr>

        {% load all_approved %}
        {% for place, apps_a_week in table.content %}
    	<tr>
            <td class="place">{{ place }}</td>
            {% for apps_everyday in apps_a_week %}
                {% for apps in apps_everyday %}
                    {% if apps %}
                    <td class="{% if apps|all_approved %}red{%else%}gray{%endif%}"
                        data-app-id="[{% for app in apps %} {id:'{{ app.id }}', title:'{{app.activity}}', approved:'{{ app.approved }}' }, {% endfor %}]" onclick="javascript:showAppList(this.getAttribute('data-app-id'), 'student_activity_center' )">
                        </td>
                    {% else %}
    		        <td class="blue"></td>
                    {% endif %}
                {% endfor %}
            {% endfor %}
    	</tr>
        {% endfor %}

    </table>
{% endblock %}
